﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;

namespace Bzzb.Model
{
    [Table(Name = "user")]
    public class User
    {
        [Column(IsIdentity = true, IsPrimary = true, Name = "id")]
        [JsonProperty("id")]
        public long Id { get; set; }

        [Column(Name = "username")]
        [JsonProperty("username")]
        public string Username { get; set; }

        [Column(Name = "password")]
        [JsonProperty("password")]
        public string Password { get; set; }

        [Column(Name = "name")]
        [Description("用户姓名")]
        [JsonProperty("name")]
        public string Name { get; set; }

        [Column(Name = "duty")]
        [Description("班值")]
        [JsonProperty("duty")]
        public string Duty { get; set; }

        [Column(Name = "role")]
        [Description("角色")]
        [JsonProperty("role")]
        public string Role { get; set; }

        [Column(Name = "workstatus")]
        [JsonProperty("workstatus")]
        [Description("在职状态")]
        public string Workstatus { get; set; }

        [Column(Name = "created", ServerTime = DateTimeKind.Local, CanUpdate = false, DbType = "datetime(0) NOT NULL")]
        [JsonProperty("created")]
        public DateTime CreateTime { get; set; }

        [Column(Name= "updated", ServerTime = DateTimeKind.Local, DbType = "datetime(0) NOT NULL")]
        [JsonProperty("updated")]
        public DateTime UpdateTime { get; set; }
    }
}
